import java.util.Scanner;

public class HihoCoder1485 {

	static String value1 = new String();
	static String value2 = new String();
	static boolean ishead = true;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String value = in.next();
		if(!checkOut(value)){
			System.out.println("-1");
		}else{
		while(checkOut(value)){
			value1= value;
			value=value.substring(1);
			checkOut(value);
		}
		while(checkOut(value1)){
			value2=value1;
			value1=value1.substring(0,value1.length()-1);
			checkOut(value1);
		}
		
		System.out.println(value2);
		System.out.println(value2.length());
		}
	}

	public static boolean checkOut(String value) {
		int h = 0;
		int i = 0;
		int o = 0;
		char[] item = value.toCharArray();
		for (int z = 0; z < item.length; z++) {
			if (item[z] == 'h') {
				h++;
			}
			if (item[z] == 'i') {
				i++;
			}
			if (item[z] == 'o') {
				o++;
			}
		}
		if (h >= 2 && i >= 1 && o >= 1) {		
			return true;
		}
		return false;
	}

}
